package com.zhongdone.pattern.structural.bridge.message.demo;

public class Test {

    public static void main(String[] args) {
        // 邮件消息
        IMessage iMessage = new EmailMessage();
        // 正常消息
        AbstractMessage abstractMessage = new NomalMessage(iMessage);
        abstractMessage.sendMessage("我是正常消息", "张三");

        // 短信消息
        iMessage = new SmsMessage();
        // 紧急消息
        abstractMessage = new UrgencyMessage(iMessage);
        abstractMessage.sendMessage("我是紧急消息", "张三");

    }

}
